﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web
{
    public partial class Register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtPwd.Text.Trim() != txtPwd2.Text.Trim())
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('两次密码不一致')", true);
                return;
            }

            BLL.UserManager userManganer = new BLL.UserManager();
            if (userManganer.GetRegist(txtName.Text.Trim(), txtPwd.Text.Trim()))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('注册成功')", true);
            }
            else
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('注册失败')", true);
            }
        }
    }
}